<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="​    第一次尝鲜stm32mp157这款多核异构的芯片，这里记录一下使用CubeMX来生成M4内核的MDK工程过程。 1.下载使用stm32cube固件包​    点击 Help-&gt;Manage embedded software packages，在该窗口找到 STM32MP1 列表选项，勾选 1.3.0 版本，并点击Install Now，软件会在线下载好固件包并解压，会自动关联好。">
<meta property="og:type" content="article">
<meta property="og:title" content="用CubeMx生成stm32mp157的MDK工程">
<meta property="og:url" content="http://example.com/2021/04/05/%E7%94%A8CubeMx%E7%94%9F%E6%88%90stm32mp157%E7%9A%84MDK%E5%B7%A5%E7%A8%8B/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="​    第一次尝鲜stm32mp157这款多核异构的芯片，这里记录一下使用CubeMX来生成M4内核的MDK工程过程。 1.下载使用stm32cube固件包​    点击 Help-&gt;Manage embedded software packages，在该窗口找到 STM32MP1 列表选项，勾选 1.3.0 版本，并点击Install Now，软件会在线下载好固件包并解压，会自动关联好。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330201526.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330210221.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330204418.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330205618.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330211912.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210331210355.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210401193628.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405180100.jpg">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405180507.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405180851.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405184915.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405184917.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405191843.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405192213.png">
<meta property="article:published_time" content="2021-04-05T11:23:19.000Z">
<meta property="article:modified_time" content="2021-04-05T11:23:19.000Z">
<meta property="article:author" content="xudonglei">
<meta property="article:tag" content="stm32mp157">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330201526.png">

<link rel="canonical" href="http://example.com/2021/04/05/%E7%94%A8CubeMx%E7%94%9F%E6%88%90stm32mp157%E7%9A%84MDK%E5%B7%A5%E7%A8%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>用CubeMx生成stm32mp157的MDK工程 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/05/%E7%94%A8CubeMx%E7%94%9F%E6%88%90stm32mp157%E7%9A%84MDK%E5%B7%A5%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          用CubeMx生成stm32mp157的MDK工程
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-05 19:23:19" itemprop="dateCreated datePublished" datetime="2021-04-05T19:23:19+08:00">2021-04-05</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2021/04/05/%E7%94%A8CubeMx%E7%94%9F%E6%88%90stm32mp157%E7%9A%84MDK%E5%B7%A5%E7%A8%8B/" class="post-meta-item leancloud_visitors" data-flag-title="用CubeMx生成stm32mp157的MDK工程" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/05/%E7%94%A8CubeMx%E7%94%9F%E6%88%90stm32mp157%E7%9A%84MDK%E5%B7%A5%E7%A8%8B/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/05/%E7%94%A8CubeMx%E7%94%9F%E6%88%90stm32mp157%E7%9A%84MDK%E5%B7%A5%E7%A8%8B/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>​    第一次尝鲜stm32mp157这款多核异构的芯片，这里记录一下使用CubeMX来生成M4内核的MDK工程过程。</p>
<h2 id="1-下载使用stm32cube固件包"><a href="#1-下载使用stm32cube固件包" class="headerlink" title="1.下载使用stm32cube固件包"></a>1.下载使用stm32cube固件包</h2><p>​    点击 Help-&gt;Manage embedded software packages，在该窗口找到 STM32MP1 列表选项，勾选 1.3.0 版本，并点击Install Now，软件会在线下载好固件包并解压，会自动关联好。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330201526.png" style="zoom:40%;">

<h2 id="2-工程建立"><a href="#2-工程建立" class="headerlink" title="2. 工程建立"></a>2. 工程建立</h2><h3 id="2-1-初步建立工程"><a href="#2-1-初步建立工程" class="headerlink" title="2.1 初步建立工程"></a>2.1 初步建立工程</h3><p>​    点击 ACCESS TO MCU SELECTOR，我手边的板子是百问网的100ASK_STM32MP157_V11开发板，板子上的mcu型号是stm32mp157DAC1，双击选中芯片型号后，弹出主设计界面。</p>
<h3 id="2-2-HSE时钟源设置"><a href="#2-2-HSE时钟源设置" class="headerlink" title="2.2 HSE时钟源设置"></a>2.2 HSE时钟源设置</h3><p>​    STM32MP157的M4，拥有五个时钟源：</p>
<ul>
<li><p>HSI(High-speed internal oscillator)：</p>
<p>HIS 是内部的高速 RC 振荡器，频率 64MHz。因为是内部提供，可以降低成本，缺点是精度较差。</p>
</li>
<li><p>HSE(High-speed external oscillator):</p>
<p>HSE 是外部的高速振荡器，需要外部电路晶振，输入频率范围要求为 4-48MHz。因为需要外部电路提供，成本会增加，但精度较好。</p>
</li>
<li><p>LSI(Low-speed internal oscillator)：</p>
<p>LSI 是内部的低速 RC 振荡器，频率 32KHz。一般用于看门狗、RTC 实时时钟、DAC 等。</p>
</li>
<li><p>LSE(Low-speed external oscillator):</p>
<p>LSE 是外部的低速振荡器，需要外部电路晶振，输入频率范围要求为 0-1000KHz，常使用 32.768KHz。一般用于 RTC 实时时钟。</p>
</li>
<li><p>CSI(Low-power internal oscillator):</p>
<p>CSI 是内部的低功耗 RC 振荡器，频率 4MHz。主要用于低功耗，需要低功耗时代替 64MHz 的 HSI。</p>
<p>我们这里选择使用HSE作为时钟源，如下图所示。</p>
</li>
</ul>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330210221.png" style="zoom:40%;">

<p>HSE我们选择了Crystal/Ceramic Resonator，表示选择外部晶振作为它们的时钟源。我们开发板的外部高速晶振（HSE）是：24MHZ。</p>
<h3 id="2-3-时钟树配置"><a href="#2-3-时钟树配置" class="headerlink" title="2.3 时钟树配置"></a>2.3 时钟树配置</h3><p>​    打开时钟树配置图，可以看到MCU的时钟默认使用的是64MHz 的HSI，如下图所示：</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330204418.png"></p>
<p>我们这边改成使用HSE，并将最后的MCU系统时钟设置到209MHz，如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330205618.png" style="zoom:80%;">

<h3 id="2-4-生成工程源码"><a href="#2-4-生成工程源码" class="headerlink" title="2.4 生成工程源码"></a>2.4 生成工程源码</h3><p>​    进入Project Manager-&gt;Project 选项来配置工程，其他地方可以不改。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210330211912.png" style="zoom:40%;">

<p>​    再打开Project Manager-&gt;Code Generator选项，勾选 Generate </p>
<p>peripheral initialization as a pair of .c/.h‘files per peripheral，勾选这个选项的话将会将每个外设单独生成一组.c和.h 文件，这使得代码结构更加的清晰。</p>
<p>​    到这工程基本算配置好了，再点击蓝色按钮(GENERATE CODE)就可以生成工程。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210331210355.png" style="zoom:50%;">

<p>​    这里挑几个文件夹，简单介绍一下。</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210401193628.png"></p>
<h2 id="3-测试"><a href="#3-测试" class="headerlink" title="3. 测试"></a>3. 测试</h2><p>​    为了测试工程，我们这边调用HAL_RCC_GetSystemCoreClockFreq()，获取设置后的新系统时钟，看是否是我们设置的209MHz。</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">  <span class="comment">/* USER CODE BEGIN 1 */</span></span><br><span class="line">  <span class="keyword">static</span> <span class="keyword">uint32_t</span> sys_freq = <span class="number">0</span>; </span><br><span class="line">  <span class="comment">/* USER CODE END 1 */</span></span><br><span class="line">  <span class="comment">/* MCU Configuration-------------------------------------------------*/</span></span><br><span class="line">  <span class="comment">/* Reset of all peripherals, Initializes the Flash interface and the Systick. */</span></span><br><span class="line">  HAL_Init();</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* USER CODE BEGIN Init */</span></span><br><span class="line">  <span class="comment">/* USER CODE END Init */</span></span><br><span class="line">  <span class="keyword">if</span>(IS_ENGINEERING_BOOT_MODE())</span><br><span class="line">  &#123;</span><br><span class="line">    <span class="comment">/* Configure the system clock */</span></span><br><span class="line">    SystemClock_Config();</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="comment">/* USER CODE BEGIN SysInit */</span></span><br><span class="line">  <span class="comment">/* USER CODE END SysInit */</span></span><br><span class="line">  <span class="comment">/* Initialize all configured peripherals */</span></span><br><span class="line">  MX_GPIO_Init();</span><br><span class="line">  <span class="comment">/* USER CODE BEGIN 2 */</span></span><br><span class="line">  sys_freq = HAL_RCC_GetSystemCoreClockFreq();</span><br><span class="line">  <span class="comment">/* USER CODE END 2 */</span></span><br><span class="line">  <span class="comment">/* Infinite loop */</span></span><br><span class="line">  <span class="comment">/* USER CODE BEGIN WHILE */</span></span><br><span class="line">  <span class="keyword">while</span> (<span class="number">1</span>)</span><br><span class="line">  &#123;</span><br><span class="line">    <span class="comment">/* USER CODE END WHILE */</span></span><br><span class="line">    <span class="comment">/* USER CODE BEGIN 3 */</span></span><br><span class="line">  &#125;</span><br><span class="line">  <span class="comment">/* USER CODE END 3 */</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="4-用ST-LINK下载和仿真调试程序"><a href="#4-用ST-LINK下载和仿真调试程序" class="headerlink" title="4. 用ST LINK下载和仿真调试程序"></a>4. 用ST LINK下载和仿真调试程序</h2><p>​    将BOOT设置为001,设置为M4内核启动。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405180100.jpg" style="zoom:20%;">

<p>​    在keil中设置我们的仿真器：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405180507.png" style="zoom:33%;">

<p>​    接下来还需要在 Utilities 选项卡里面设置下载时的目标编程器：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405180851.png" style="zoom:50%;">

<p>​    勾选“Use Debug Driver”，选择 ST LINK 来调试、下载。“Update Target before Debuggin”顾名思义，就是在调试之前先将代码下载到目标器件中，由于 STM32MP157 M4 没有内部 Flash，因此绝对不能勾选此选项！否则仿真就会失败，对于那些内置 Flash 的 STM32 单片机需要勾选此选项。</p>
<p>​    点击开始/停止仿真按钮，直接报错了。。。。。如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405184915.png" style="zoom:50%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405184917.png" style="zoom:50%;">

<p>​    查阅网上资料，发现有网友有遇到过同样的问题，按照他的方法可以解决这个问题：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405191843.png" style="zoom:47%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/20210405192213.png" style="zoom:67%;">

<p>sys_freq的值为209000128，说明我们工程没有问题。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/stm32mp157/" rel="tag"># stm32mp157</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/04/01/cmake%E5%B9%B6%E8%A1%8C%E6%89%A7%E8%A1%8C/" rel="prev" title="cmake并行执行">
      <i class="fa fa-chevron-left"></i> cmake并行执行
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/04/05/STM32%E4%BD%BF%E7%94%A8RTC%E6%97%B6%E9%92%9F%E5%8F%8A%E9%97%B9%E9%92%9F%E5%8A%9F%E8%83%BD/" rel="next" title="STM32使用RTC时钟及闹钟功能">
      STM32使用RTC时钟及闹钟功能 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E4%B8%8B%E8%BD%BD%E4%BD%BF%E7%94%A8stm32cube%E5%9B%BA%E4%BB%B6%E5%8C%85"><span class="nav-number">1.</span> <span class="nav-text">1.下载使用stm32cube固件包</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E5%B7%A5%E7%A8%8B%E5%BB%BA%E7%AB%8B"><span class="nav-number">2.</span> <span class="nav-text">2. 工程建立</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E5%88%9D%E6%AD%A5%E5%BB%BA%E7%AB%8B%E5%B7%A5%E7%A8%8B"><span class="nav-number">2.1.</span> <span class="nav-text">2.1 初步建立工程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-HSE%E6%97%B6%E9%92%9F%E6%BA%90%E8%AE%BE%E7%BD%AE"><span class="nav-number">2.2.</span> <span class="nav-text">2.2 HSE时钟源设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-%E6%97%B6%E9%92%9F%E6%A0%91%E9%85%8D%E7%BD%AE"><span class="nav-number">2.3.</span> <span class="nav-text">2.3 时钟树配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-%E7%94%9F%E6%88%90%E5%B7%A5%E7%A8%8B%E6%BA%90%E7%A0%81"><span class="nav-number">2.4.</span> <span class="nav-text">2.4 生成工程源码</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%B5%8B%E8%AF%95"><span class="nav-number">3.</span> <span class="nav-text">3. 测试</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E7%94%A8ST-LINK%E4%B8%8B%E8%BD%BD%E5%92%8C%E4%BB%BF%E7%9C%9F%E8%B0%83%E8%AF%95%E7%A8%8B%E5%BA%8F"><span class="nav-number">4.</span> <span class="nav-text">4. 用ST LINK下载和仿真调试程序</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
